﻿@model ASP.NetCore2_NLog_Web_Example.Models.MessageModel

@{
    ViewData["Title"] = "Contact";
}
<h2>@ViewData["Title"]</h2>
<h3>@ViewData["Message"]</h3>

<address>
    One Microsoft Way<br />
    Redmond, WA 98052-6399<br />
    <abbr title="Phone">P:</abbr>
    425.555.0100
</address>

<address>
    <strong>Support:</strong> <a href="mailto:Support@example.com">Support@example.com</a><br />
    <strong>Marketing:</strong> <a href="mailto:Marketing@example.com">Marketing@example.com</a>
</address>

@if (ViewData["Posted"] is bool b && b)
{
    <div>Message posted!</div>
}
else
{
    <form asp-action="PostMessage" asp-controller="Home" method="post">
        <div>
            <input asp-for="From" placeholder="From" autofocus/>
        </div>
        <div>
            <textarea asp-for="Message" placeholder="Message"></textarea>
        </div>

        <div>
            <button type="submit">Post</button>
        </div>

    </form>
}
